import sqlalchemy

from sqlalchemy import create_engine
from sqlalchemy.orm.exc import MultipleResultsFound, NoResultFound
from base import User, session, Base, engine
from sqlalchemy import Column, Integer, String


split = "\n####################\n"


# Base.metadata.create_all(engine)

jack = User(name='jack', fullname='Jack Bean', password='gjffdd')
print(jack.addresses)

jack.addresses = [Address(email_address='jack@google.com'), Address(email_address='j25@yahoo.com')]
print(jack.addresses[1])
print(jack.addresses[1].user)
# session.add(jack)
# session.commit()

jack = session.query(User).filter_by(name='jack').one()
print(jack)
print(jack.addresses)
